<?php

/**
 * AJAX
 * 
 * The AJAX controller.
 * 
 * @author Oliver Schwarz <oliver.schwarz@vaicon.de>
 * @package Controller
 */
class Ajax
{

        private $aUser, $oTpl, $oCtrl;

        public function __construct()
        {
                $this->aUser = Auth::check();
                $this->oTpl = TPL::getInstance();
                $this->oCtrl = Util::parseRequest();
        }
        public function run()
        {
                switch($this->oCtrl->action):
                        case 'messages':
                                $m = Util::loadController('message');
                                $this->oTpl->assign('messages', $m->get());
                                echo $this->oTpl->fetch('messages.htpl');
                        break;
                endswitch;
        }

}

?>